var t = require("../../../@babel/runtime/helpers/defineProperty"), i = getApp();

Component({
    properties: {
        goods_plugin: {
            type: null
        }
    },
    lifetimes: {
        attached: function() {
            this.setData({
                show: !1,
                boxShow: !1
            }), this.data.goods_plugin.plugin && this.data.goods_plugin.plugin.micro_communities && this.setData({
                boxShow: !0,
                micro_communities: this.data.goods_plugin.plugin.micro_communities,
                min_micr: this.data.goods_plugin.plugin.micro_communities.list.slice(0, 2)
            });
        }
    },
    data: {
        show: !1,
        boxShow: !1,
        micro_communities: [],
        min_micr: [],
        page: 1
    },
    methods: {
        tapShow: function() {
            this.setData({
                show: !0,
                page: 1
            });
            var o = this, a = i.getNetAddresss("plugin.micro-communities.api.goods.index");
            i._getNetWork({
                url: a,
                data: {
                    page: this.data.page,
                    goods_id: this.data.goods_plugin.get_goods.id
                },
                success: function(i) {
                    var a, s = i.data;
                    1 == s.result && o.setData((t(a = {}, "micro_communities.list", s.data.data), t(a, "last_page", s.data.last_page), 
                    a));
                },
                fail: function(t) {
                    console.log(t);
                }
            });
        },
        getMore: function() {
            this.setData({
                page: this.data.page + 1
            }), wx.showLoading({
                title: "加载中"
            });
            var o = this, a = i.getNetAddresss("plugin.micro-communities.api.goods.index");
            i._getNetWork({
                url: a,
                data: {
                    page: this.data.page,
                    goods_id: this.data.goods_plugin.get_goods.id
                },
                success: function(i) {
                    var a, s = i.data;
                    1 == s.result && o.setData((t(a = {}, "micro_communities.list", o.data.micro_communities.list.concat(s.data.data)), 
                    t(a, "last_page", s.data.last_page), a));
                    wx.hideLoading({
                        success: function(t) {}
                    });
                },
                fail: function(t) {
                    console.log(t);
                }
            });
        },
        errorImg: function(t) {
            console.log(t);
        },
        closeShow: function() {
            this.setData({
                show: !1
            });
        },
        goMicro: function(t) {
            var i = t.currentTarget.dataset.id;
            wx.navigateTo({
                url: "/packageC/micro_communities/microCommentDetails/microCommentDetails?stickId=" + i
            });
        }
    }
});